using System;
using Colorful.Furniture.IEntity;
using FreeSql.DataAnnotations;

namespace Colorful.Furniture.UserManagement
{
    /// <summary>
    /// 用户授权（其他身份验证）
    /// </summary>
    [Table(Name = "usr_user_identity")]
    public class UserIdentity : IAddTime
    {
        /// <summary>
        /// 编码
        /// </summary>
        [Column(Name = "id", IsPrimary = true)]
        public Guid Id { get; set; }

        /// <summary>
        /// 用户编码
        /// </summary>
        [Column(Name = "user_id")]
        public Guid? UserId { get; set; }

        /// <summary>
		/// 凭证，当认证类型为用户名时，存密码
		/// </summary>
		[Column(Name = "credential", StringLength = 100)]
        public string Credential { get; set; }

        /// <summary>
        /// 认证者，如user_name 或者是授权之后的昵称
        /// </summary>
        [Column(Name = "identifier", StringLength = 30)]
        public string Identifier { get; set; }

        /// <summary>
        /// 认证类型，如 Password，GitHub、QQ、WeiXin、PhoneNumber等
        /// </summary>
        [Column(Name = "identity_type", StringLength = 50)]
        public string IdentityType { get; set; }

        /// <summary>
        ///  描述
        /// </summary>
        [Column(Name = "remark", StringLength = 100)]
        public string Remark { get; set; }

        /// <summary>
        ///  添加时间
        /// </summary>
        [Column(Name = "add_time")]
        public DateTime AddTime { get; set; }

        #region 外键 => 导航属性，ManyToOne/OneToOne

        /// <summary>
        ///  用户
        /// </summary>
        public virtual User User { get; set; }

        #endregion

        #region 外键 => 导航属性，ManyToMany

        #endregion

        
    }

}
